<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>银行账户</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="mx-auto max-w-[393px] h-[852px] bg-white relative overflow-hidden rounded-[40px] shadow-2xl">
        <!-- Status Bar -->
        <div class="bg-white px-6 pt-3 pb-2">
            <div class="flex justify-between items-center text-xs">
                <span class="font-semibold">9:41</span>
                <div class="flex space-x-1">
                    <i class="fas fa-signal"></i>
                    <i class="fas fa-wifi"></i>
                    <i class="fas fa-battery-full"></i>
                </div>
            </div>
        </div>

        <!-- Header -->
        <div class="bg-gradient-to-r from-green-600 to-emerald-600 px-4 py-3">
            <div class="flex items-center justify-between text-white">
                <a href="b2b-profile.html" class="text-white">
                    <i class="fas fa-arrow-left text-lg"></i>
                </a>
                <h1 class="text-lg font-semibold">银行账户</h1>
                <button onclick="addBankAccount()" class="text-white hover:opacity-80">
                    <i class="fas fa-plus text-lg"></i>
                </button>
            </div>
        </div>

        <!-- Account Balance Card -->
        <div class="px-4 py-3 bg-gradient-to-r from-green-600 to-emerald-600">
            <div class="bg-white/10 backdrop-blur-sm rounded-xl p-4">
                <div class="text-white">
                    <p class="text-sm opacity-80 mb-1">总资产</p>
                    <p class="text-2xl font-bold mb-3">¥168,526.80</p>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <p class="text-xs opacity-80">可用余额</p>
                            <p class="text-lg font-semibold">¥155,946.80</p>
                        </div>
                        <div>
                            <p class="text-xs opacity-80">冻结金额</p>
                            <p class="text-lg font-semibold">¥12,580.00</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Scrollable Content -->
        <div class="h-[calc(852px-220px)] overflow-y-auto pb-20">
            <!-- Settlement Accounts -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center justify-between">
                    <span class="flex items-center">
                        <span class="w-1 h-4 bg-green-600 mr-2 rounded-full"></span>
                        结算账户
                    </span>
                    <span onclick="addBankAccount()" class="text-green-600 text-xs cursor-pointer hover:text-green-700">
                        <i class="fas fa-plus mr-1"></i>添加账户
                    </span>
                </h3>
                <div class="space-y-3">
                    <!-- Primary Bank Account -->
                    <div class="bg-white rounded-xl border border-gray-200 overflow-hidden">
                        <div class="bg-gradient-to-r from-blue-500 to-blue-600 p-4 text-white">
                            <div class="flex justify-between items-start">
                                <div>
                                    <p class="text-sm opacity-90 mb-1">中国工商银行</p>
                                    <p class="text-lg font-bold">**** **** **** 8866</p>
                                    <p class="text-xs opacity-80 mt-1">张**</p>
                                </div>
                                <div class="text-right">
                                    <span class="bg-white/20 text-xs px-2 py-1 rounded-full">主账户</span>
                                    <p class="text-xs opacity-80 mt-2">开户行: 朝阳支行</p>
                                </div>
                            </div>
                        </div>
                        <div class="p-3">
                            <div class="flex justify-between items-center text-sm">
                                <span class="text-gray-600">账户状态</span>
                                <span class="text-green-600 font-medium">正常</span>
                            </div>
                            <div class="flex justify-between items-center text-sm mt-2">
                                <span class="text-gray-600">上次结算</span>
                                <span class="font-medium">2025-01-08 15:30</span>
                            </div>
                            <div class="flex space-x-2 mt-3">
                                <button onclick="viewAccountDetails('icbc-8866')" class="flex-1 bg-blue-50 text-blue-600 text-xs py-2 rounded-lg hover:bg-blue-100 transition-colors">
                                    查看详情
                                </button>
                                <button onclick="editBankAccount('icbc-8866')" class="bg-gray-50 text-gray-600 text-xs px-3 py-2 rounded-lg hover:bg-gray-100 transition-colors">
                                    编辑
                                </button>
                            </div>
                        </div>
                    </div>

                    <!-- Secondary Bank Account -->
                    <div class="bg-white rounded-xl border border-gray-200 overflow-hidden">
                        <div class="bg-gradient-to-r from-red-500 to-red-600 p-4 text-white">
                            <div class="flex justify-between items-start">
                                <div>
                                    <p class="text-sm opacity-90 mb-1">中国建设银行</p>
                                    <p class="text-lg font-bold">**** **** **** 1234</p>
                                    <p class="text-xs opacity-80 mt-1">张**</p>
                                </div>
                                <div class="text-right">
                                    <span class="bg-white/20 text-xs px-2 py-1 rounded-full">备用账户</span>
                                    <p class="text-xs opacity-80 mt-2">开户行: 国贸支行</p>
                                </div>
                            </div>
                        </div>
                        <div class="p-3">
                            <div class="flex justify-between items-center text-sm">
                                <span class="text-gray-600">账户状态</span>
                                <span class="text-green-600 font-medium">正常</span>
                            </div>
                            <div class="flex justify-between items-center text-sm mt-2">
                                <span class="text-gray-600">添加时间</span>
                                <span class="font-medium">2024-12-15</span>
                            </div>
                            <div class="flex space-x-2 mt-3">
                                <button onclick="viewAccountDetails('ccb-1234')" class="flex-1 bg-red-50 text-red-600 text-xs py-2 rounded-lg hover:bg-red-100 transition-colors">
                                    查看详情
                                </button>
                                <button onclick="editBankAccount('ccb-1234')" class="bg-gray-50 text-gray-600 text-xs px-3 py-2 rounded-lg hover:bg-gray-100 transition-colors">
                                    编辑
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Settlement Settings -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center">
                    <span class="w-1 h-4 bg-green-600 mr-2 rounded-full"></span>
                    结算设置
                </h3>
                <div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
                    <div class="p-3 border-b border-gray-100">
                        <div class="flex justify-between items-center">
                            <div>
                                <p class="text-sm font-medium">自动结算</p>
                                <p class="text-xs text-gray-500 mt-1">每日自动提现到主账户</p>
                            </div>
                            <label class="relative inline-flex items-center cursor-pointer">
                                <input type="checkbox" checked class="sr-only peer">
                                <div class="w-9 h-5 bg-gray-200 rounded-full peer peer-checked:bg-green-500 peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all"></div>
                            </label>
                        </div>
                    </div>
                    <div class="p-3 border-b border-gray-100">
                        <div class="flex justify-between items-center">
                            <span class="text-sm text-gray-600">结算周期</span>
                            <div class="flex items-center">
                                <span class="text-sm font-medium mr-2">T+1</span>
                                <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
                            </div>
                        </div>
                    </div>
                    <div class="p-3 border-b border-gray-100">
                        <div class="flex justify-between items-center">
                            <span class="text-sm text-gray-600">最低结算金额</span>
                            <div class="flex items-center">
                                <span class="text-sm font-medium mr-2">¥100</span>
                                <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
                            </div>
                        </div>
                    </div>
                    <div class="p-3">
                        <div class="flex justify-between items-center">
                            <span class="text-sm text-gray-600">手续费率</span>
                            <span class="text-sm font-medium">0.6%</span>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Recent Transactions -->
            <div class="p-4">
                <h3 class="font-semibold mb-3 flex items-center justify-between">
                    <span class="flex items-center">
                        <span class="w-1 h-4 bg-green-600 mr-2 rounded-full"></span>
                        最近交易
                    </span>
                    <span onclick="viewAllTransactions()" class="text-green-600 text-xs cursor-pointer hover:text-green-700">
                        查看全部 <i class="fas fa-chevron-right text-xs"></i>
                    </span>
                </h3>
                <div class="space-y-3">
                    <!-- Transaction 1 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-3">
                        <div class="flex items-center justify-between">
                            <div class="flex items-center">
                                <div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center mr-3">
                                    <i class="fas fa-arrow-down text-blue-600 text-sm"></i>
                                </div>
                                <div>
                                    <p class="text-sm font-medium">自动结算</p>
                                    <p class="text-xs text-gray-500">工商银行(8866)</p>
                                </div>
                            </div>
                            <div class="text-right">
                                <p class="text-sm font-bold text-blue-600">¥10,000.00</p>
                                <p class="text-xs text-gray-400">今天 10:32</p>
                            </div>
                        </div>
                    </div>

                    <!-- Transaction 2 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-3">
                        <div class="flex items-center justify-between">
                            <div class="flex items-center">
                                <div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center mr-3">
                                    <i class="fas fa-plus text-green-600 text-sm"></i>
                                </div>
                                <div>
                                    <p class="text-sm font-medium">收款入账</p>
                                    <p class="text-xs text-gray-500">订单收款</p>
                                </div>
                            </div>
                            <div class="text-right">
                                <p class="text-sm font-bold text-green-600">+¥1,298.00</p>
                                <p class="text-xs text-gray-400">昨天 18:45</p>
                            </div>
                        </div>
                    </div>

                    <!-- Transaction 3 -->
                    <div class="bg-white rounded-lg border border-gray-200 p-3">
                        <div class="flex items-center justify-between">
                            <div class="flex items-center">
                                <div class="w-8 h-8 bg-red-100 rounded-full flex items-center justify-center mr-3">
                                    <i class="fas fa-minus text-red-600 text-sm"></i>
                                </div>
                                <div>
                                    <p class="text-sm font-medium">手续费</p>
                                    <p class="text-xs text-gray-500">提现手续费</p>
                                </div>
                            </div>
                            <div class="text-right">
                                <p class="text-sm font-bold text-red-600">-¥60.00</p>
                                <p class="text-xs text-gray-400">昨天 18:45</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Security Features -->
            <div class="p-4 pb-8">
                <h3 class="font-semibold mb-3 flex items-center">
                    <span class="w-1 h-4 bg-green-600 mr-2 rounded-full"></span>
                    安全保障
                </h3>
                <div class="grid grid-cols-2 gap-3">
                    <div class="bg-gradient-to-br from-blue-50 to-blue-100 rounded-xl p-3 border border-blue-200 text-center">
                        <i class="fas fa-shield-alt text-2xl text-blue-600 mb-2"></i>
                        <p class="text-xs font-medium">银行级加密</p>
                        <p class="text-xs text-gray-600 mt-1">256位SSL加密</p>
                    </div>
                    <div class="bg-gradient-to-br from-green-50 to-green-100 rounded-xl p-3 border border-green-200 text-center">
                        <i class="fas fa-lock text-2xl text-green-600 mb-2"></i>
                        <p class="text-xs font-medium">资金保障</p>
                        <p class="text-xs text-gray-600 mt-1">第三方监管</p>
                    </div>
                    <div class="bg-gradient-to-br from-purple-50 to-purple-100 rounded-xl p-3 border border-purple-200 text-center">
                        <i class="fas fa-user-shield text-2xl text-purple-600 mb-2"></i>
                        <p class="text-xs font-medium">实名认证</p>
                        <p class="text-xs text-gray-600 mt-1">身份验证保护</p>
                    </div>
                    <div class="bg-gradient-to-br from-orange-50 to-orange-100 rounded-xl p-3 border border-orange-200 text-center">
                        <i class="fas fa-clock text-2xl text-orange-600 mb-2"></i>
                        <p class="text-xs font-medium">24小时监控</p>
                        <p class="text-xs text-gray-600 mt-1">异常交易预警</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- Bottom Action Bar -->
        <div class="absolute bottom-1 left-0 right-0 bg-white border-t border-gray-200 px-4 py-3 shadow-lg">
            <div class="flex space-x-3">
                <button onclick="withdraw()" class="flex-1 bg-green-600 text-white font-medium py-2.5 rounded-lg hover:bg-green-700 transition-colors">
                    <i class="fas fa-money-check-alt mr-2"></i>立即提现
                </button>
                <button onclick="viewStatement()" class="bg-gray-100 text-gray-700 font-medium px-4 py-2.5 rounded-lg hover:bg-gray-200 transition-colors">
                    <i class="fas fa-file-invoice"></i>
                </button>
            </div>
        </div>
    </div>

    <script>
        // Add new bank account
        function addBankAccount() {
            window.location.href = 'add-bank-account.html';
        }

        // View account details
        function viewAccountDetails(accountId) {
            window.location.href = `b2b-bank-account-detail.html?account=${accountId}`;
        }

        // Edit bank account
        function editBankAccount(accountId) {
            window.location.href = `b2b-edit-bank-account.html?account=${accountId}`;
        }

        // Withdraw
        function withdraw() {
            window.location.href = 'b2b-withdraw.html';
        }

        // View statement
        function viewStatement() {
            window.location.href = 'b2b-statement.html';
        }

        // View all transactions
        function viewAllTransactions() {
            window.location.href = 'b2b-all-transactions.html';
        }

        // Toast notification
        function showToast(message) {
            const toast = document.createElement('div');
            toast.className = 'fixed top-20 left-1/2 transform -translate-x-1/2 bg-gray-800 text-white px-4 py-2 rounded-lg text-sm z-50';
            toast.textContent = message;
            document.body.appendChild(toast);
            
            setTimeout(() => {
                toast.remove();
            }, 2000);
        }

        // Initialize page
        document.addEventListener('DOMContentLoaded', function() {
            showToast('银行账户信息已加载');
        });
    </script>
</body>
</html>